package com.jishuo.nontax.bfc.dao;

import com.jishuo.nontax.bean.bank.Bank;
import com.jishuo.nontax.bean.vo.ChargeBillDetailVO;
import com.jishuo.nontax.bean.vo.ChargeBillVO;
import com.jishuo.nontax.bean.vo.CheckDataVO;
import com.jishuo.nontax.bean.vo.NumAmtVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;


/**
 * @author :hlp
 * @create :2022-12-05 16:26:00
 */
@Mapper
public interface ChargeBillMapper {

    ChargeBillVO findChargeBill(String billnum);

    int selectChargeBill(ChargeBillVO chargebill);

    ChargeBillVO findChargeBillActionstate(@Param("billnum") String billnum, @Param("billtypeid") Integer billtypeid, @Param("keyword") Integer keyword);

    long selectChargeBillMax(String billNum);

    Bank getAccountcode(String billnum);

    int findBillTypeByKeyWord(String keyWord);

    int findPayWay(String paywaycode);

    int selectBankaffirmCount(@Param("bankaffirm") String bankaffirm ,@Param("bankid") Long bankid ,@Param("paybankdt") String paybankdt );

    ChargeBillVO findChargeBillByID(String billnum);

    ChargeBillVO findChargeBillid(Long billid);

    int updateChargeBillNum(ChargeBillVO chargebill);

    int updateChargeBillNumPay(ChargeBillVO chargebill);

    int updateChargeBill(ChargeBillVO chargebill);

    int updateChargeBillId(ChargeBillVO chargebill);

    /**
     * 冲销
     * @param billnum 单号
     * @return
     */
    int backOutChargeBill(String billnum);

    int saveChargeBillManualDetail(List<ChargeBillDetailVO> chargeBillVOS);

    int saveChargeBillManualDetailPart(List<ChargeBillDetailVO> chargeBillVOS);

    int saveChargeBill(ChargeBillVO chargeBill);

    int deleteChargebilldetail(Long billid);

    int deleteChargebilldetailId(Long detailid);

    ArrayList<ChargeBillDetailVO> chargeBillDetailList(Long billid);

    int updateChargeBillIsActivestate(@Param("messageid")long messageid,@Param("billstate") int billstate);

    NumAmtVO selectCharBillNumAmt(@Param("bankid")String bankid, @Param("paybankdt")String paybankdt);

    int deleteChargebillfiance(@Param("bankid")String bankid, @Param("paybankdt")String paybankdt,@Param("bankaffirm")String bankaffirm);

    int saveChargebillfiance(CheckDataVO checkDataVO);

    List<ChargeBillVO> selectChargeBillPage(ChargeBillVO chargeBillVO);

    /**
     * 根据id集合查询票据信息
     * @param billids
     * @return
     */
    List<ChargeBillVO> findChargeBillList(long[] billids);
}
